# -*- coding: utf-8 -*-
from wordcloud import WordCloud
import numpy as np
from PIL import Image
import jieba
mask = np.array(Image.open("love.jpg"))
wcd = WordCloud(background_color=None, repeat=True, max_words=500, height=480, width=854,
                max_font_size=100, font_path="fonts/msyh.ttc", colormap="RdPu",mask=mask,
                mode="RGBA")

text = "修理家中用具,洗碗,刷马桶,洗衣服"

# ss = " ".join(jieba.lcut(text))
wcd.generate(text)
wcd.to_image()
wcd.to_file("wordcloud-love.png")
